package configuration

import (
	"encoding/json"
	"errors"
	"kop/modules/configuration/client"
	"kop/util/log"
)

const BossID = 5050

func init() {

	var err error
	if err = json.Unmarshal(client.Load("StageWorld"), &BossConfigs); err != nil {
		panic(err)
	}

	log.Info("Load StageWorld.json success.")

	var _, ok = BossConfigs[BossID]
	if !ok {
		panic(errors.New("WorldBoss not found [5050]"))
	}
}

// Boss
type BossConf struct {
	ID            int32  // 副本ID
	Name          string // 副本名称
	Score         int32  // 副本积分
	Coupon        int32  // 副本货币：幽灵币
	AttackAwardID int32  // 攻击奖励ID
	KillAwardID   int32  // 击杀奖励ID
	BossHP        int64  // 首领血量
}

var BossConfigs = map[int32]BossConf{}

func GetBoss() BossConf {
	return BossConfigs[BossID]
}

func GetLittleBoss(level int32) BossConf {
	return BossConfigs[level]
}
